<?php

class SideBar extends Engine {

    public static function showShoppingBasket() {
        $cartShop = self::$S->Get('cart');
        $contentCart = Db_Products_Products::getProductListForCart($cartShop);
        $amountList = array();
        $sumEnvelope = 0;
        if ($contentCart) {
            foreach ($cartShop as $key=>$memoryProductList) {
                if (!empty($cartShop[$key]['amount'])) {
                    $amountList[] = $cartShop[$key]['amount'];
                } else {
                    $amountList[] = 0;
                }
                //$sumEnvelope += $cartShop[$key]['envelope'];
            }
        }
        self::$TPL->assign('amountList', $amountList);
        self::$TPL->assign('sumEnvelope', $sumEnvelope);
        self::$TPL->assign('contentCart', $contentCart);
        self::$TPL->display('shopping_basket');
        return;
    }

    public static function showWishList() {
        $countWishProduct = 0;
        $countWishProduct += count(Db_Products_MemoryListProducts::getAllProductsByMemoryIdentifier($_COOKIE[MEMORY_LIST_NAME_KEY]));
        self::$TPL->assign('countWishProduct', $countWishProduct);
        self::$TPL->display('wish_list_side_bar');
        return;
    }

    public static function showConsultancy() {
        $phoneNumber = self::$SETTINGS['phone_number'];
        $contactEmail = self::$SETTINGS['contact_email'];
        self::$TPL->assign('phoneNumber', $phoneNumber);
        self::$TPL->assign('contactEmail', $contactEmail);
        self::$TPL->display('consultancy_side_bar');
        return;
    }

    public static function showQuality() {
        self::$TPL->display('quality_side_bar');
    }

    public static function showPrices() {
        self::$TPL->display('prices_side_bar');
    }

    public static function showQuotesPoems() {
        self::$TPL->display('quotes_poems_side_bar');
    }

    public static function showReorder() {
        self::$TPL->display('reorder_side_bar');
    }

    public static function showTechnicalProblems() {
        self::$TPL->display('technical_problems_side_bar');
    }

    public static function showNotice() {
        self::$TPL->display('products/notice_side_bar');
    }
}